package com.rey.demo.encode;

import com.rey.demo.vo.UnixTime;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @ClassName: TimeEncoder1
 * @Description: TODO
 * @Author reyJojo
 * @Date 2022/1/5 10:07
 * @Version 1.0
 */
public class TimeEncoder1 extends MessageToByteEncoder<UnixTime> {
    @Override
    protected void encode(ChannelHandlerContext ctx, UnixTime msg, ByteBuf out) {
        out.writeInt((int)msg.value());
    }
}